// src/plugins/message.js
import { ElMessage } from 'element-plus';

const install = (app) => {
  const success = (message) => {
    ElMessage({
      message,
      type: 'success',
    });
  };

  const error = (message) => {
    ElMessage({
      message,
      type: 'error',
    });
  };

  const warning = (message) => {
    ElMessage({
      message,
      type: 'warning',
    });
  };

  app.config.globalProperties.$message = {
    success,
    error,
    warning,
  };
};

export default {
  install,
};
